package com.team.vlog_temp.Controller;

import com.team.vlog_temp.Dao.MeuDao;
import com.team.vlog_temp.Dao.TestDao;
import com.team.vlog_temp.Service.Impl.MeuServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin // 允许所有来源的跨域请求
public class MeuController {
    @Autowired
    private MeuDao meuDao;

    @Autowired
    private MeuServiceImpl meuService;

    //1.获取主菜单
    @RequestMapping("/getMeu")
        public List<Map<String,Object>> getMeu(){
            List<Map<String, Object>> list = meuDao.getAllMeu();return list;
    }

    //2.获取二级菜单
    @RequestMapping("/getMeuSonAndSon")
    public List<Map<String,Object>> getMeuSonAndSon(int fatherCode){
            List<Map<String, Object>> list = meuService.getErJiAndSanJiMeu(fatherCode);return list;
    }

}
